﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Littlefish.Data;

namespace Littlefish.Model.Objects
{
    public class EmailAddress : BaseBusinessObject<Data.EmailAddress, MainDataContext>
    {
        #region - Constructors -
        internal EmailAddress() : base() { }
        internal EmailAddress(MainDataContext context) : base(context) { }
        #endregion

        #region - Static Methods -
        public static EmailAddress CreateEmailAddress()
        {
            return CreateEmailAddress(null, null);
        }
        public static EmailAddress CreateEmailAddress(BusinessObjectOptions options)
        {
            return CreateEmailAddress(null, options);
        }
        public static EmailAddress CreateEmailAddress(MainDataContext context)
        {
            return CreateEmailAddress(context, null);
        }
        public static EmailAddress CreateEmailAddress(MainDataContext context, BusinessObjectOptions options)
        {
            EmailAddress ea = new EmailAddress(context);

            if (options != null)
                ea.Options = options;

            ea.NewEntity();
            return ea;
        }

        public static EmailAddress GetEmailAddress(int id)
        {
            return GetEmailAddress(id, null, null);
        }
        public static EmailAddress GetEmailAddress(int id, BusinessObjectOptions options)
        {
            return GetEmailAddress(id, null, options);
        }
        public static EmailAddress GetEmailAddress(int id, MainDataContext context)
        {
            return GetEmailAddress(id, context, null);
        }
        public static EmailAddress GetEmailAddress(int id, MainDataContext context, BusinessObjectOptions options)
        {
            EmailAddress emailAddress = new EmailAddress(context);

            if (options != null)
                emailAddress.Options = options;

            emailAddress.Load(id);
            return emailAddress;
        }
        #endregion
    }
}
